<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>贵州手机综合服务平台</title>
<link href="${contextPath}css/style.css" rel="stylesheet" type="text/css" />
<script type="text/javascript" src="${contextPath}script/jquery/jquery-1.7.2.min.js"></script>
<script type="text/javascript" src="${contextPath}script/jquery.cookie.js"></script>

<script type=text/javascript>
function selectTag(showContent,selfObj){
	// 操作标签
	var tag = document.getElementById("tags").getElementsByTagName("li");
	var taglength = tag.length;
	for(i=0; i<taglength; i++){
		tag[i].className = "";
	}
	selfObj.parentNode.className = "selectTag";
	// 操作内容
	for(i=0; j=document.getElementById("tagContent"+i); i++){
		j.style.display = "none";
	}
	document.getElementById(showContent).style.display = "block";
}
	
$(function() {
	var timeout = 0;
	if ($('html').hasClass('csstransitions'))
		timeout = 750;

	$('.login-btn').mouseenter(function() {
		$('.left-door, .right-door, .login-btn').addClass('login-animate');
		setTimeout(function() {
			$('#login-container').fadeIn(1500);
			$('.login-btn .name').fadeOut(250, function() {
				$('.login-btn .square1, .login-btn .square2').fadeIn(750);
				$('#login-email').focus();
			});
		}, timeout);
	});
});


$(function () {
	var email = $.cookie('email');
	if (null != email)
		$('#email').val(email);
});

function login() {
	var email = $('#email').val();
	var pwd = $('#pwd').val();
	if (email == '' || pwd == '') {
		alert('登录信息有误');
		return false;
	}
	
	var url = '${contextPath}userLogin.html';
	var parm = {'email':email, 'pwd':pwd};
	$.ajax({type:'POST', url:url, data:parm,
		success : function(result) {
			if ('success' == result) {
				if (document.getElementById('rememberMe').checked) {
					$.cookie('email', email, {expires:365});
				}
				location.href = '${contextPath}mobileMain.html';
			} else if ('not_find' == result)
				alert('未找到该用户！');
			else if ('pwd_error')
				alert('密码错误！');
			else if ('parameter_error' == result)
				alert('参数错误，请刷新页面后重试');
			else if ('email_or_pwd_error' == result)
				alert('邮箱或密码错误');
			else if ('no_any_rights' == result)
				alert('管理员还未给您赋予任何角色，请联系管理员');
			else if ('deleted' == result) 
				alert('您已经被管理员禁用，请联系管理员');
		}
	});
}
</script>
</head>

<body>
<div class="hearder">
	<div class="loginHearder"><img src="${contextPath}img/logo.png" alt="贵州手机综合服务平台">贵州手机综合服务平台</div>
</div>
<ul id=tags>
	<li class=selectTag><a onClick="selectTag('tagContent0',this)"   href="javascript:void(0)">用户登录</a> </li>
	<li><a onClick="selectTag('tagContent1',this)"   href="javascript:void(0)">账号申请</a> </li>
</ul>
<div id=tagContent>
	<div class="tagContent selectTag" id=tagContent0>
		<ul class="login">
			<li>用户名</li>
			<li class="m10"><input type="text" id="email" name="email" class="loginInput" value="wjw@ish365.com" /></li>
			<li>密 码</li>
			<li class="m10"><input type="password" id="pwd" name="pwd" class="loginInput" value="000000" /></li>
			<li class="m10"><input type="checkbox" id="rememberMe" class="input-themed" checked /> 记住我的登陆信息 </li>
			<li class="btn m10"><a href="javascript:;" onclick="javascript:login();">登 录</a></li>
		</ul>
	</div>
	<div class=tagContent id=tagContent1>
		<ul class="reg">
			<li><span><em>*</em>公司名称</span><input name="" type="text" class="regInput" /></li>
			<li><span><em>*</em>公司地址</span><input name="" type="text" class="regInput" /></li>
			<li><span><em>*</em>公司电话</span><input name="" type="text" class="regInput" /></li>
			<li><span><em>*</em>联系人</span><input name="" type="text" class="regInput" /></li>
			<li class="pact"><span> </span><input name="" type="checkbox" value="" checked="checked" />	<a href="${contextPath}pact.html">阅读并接受《用户协议》</a></li>
			<li class="btn"><a href="#">提交申请</a></li>
		</ul>
	</div>
</div>
<div class="footer">©2013 贵州恒盛科技发展有限公司</div>
</body>
</html>
